package com.asia5b.a5mall.middleware.logic.viewmodel.order

import androidx.lifecycle.MutableLiveData
import com.asia5b.a5mall.middleware.base.SimpleViewModel
import com.asia5b.a5mall.middleware.model.order.AftersaleDetail2Model
import io.reactivex.functions.Consumer

/**
 * Created by zhangyuncai on 2019/12/21.
 */
class AftersaleDetailActivitVM :SimpleViewModel() {


    fun getAftersaleDetail(sn: String) {
        val observable = afterSaleApi.getAfterSaleDetail(sn)
        baseSubscribe(observable, Consumer { aftersaleDetail2Model ->
//            providerView().getAftersaleDetailResult(aftersaleDetail2Model)
            getAftersaleDetailResultLiveData.value=aftersaleDetail2Model
        })
    }
    val getAftersaleDetailResultLiveData= MutableLiveData<AftersaleDetail2Model>()
    val cancelRefundResultLiveData= MutableLiveData<String>()
    fun cancelRefund(orderSn: String) {
        baseSubscribe(afterSaleApi.cancelRefund(orderSn), Consumer {
//            providerView().cancelRefundResult(orderSn)
            cancelRefundResultLiveData.value=orderSn
        })
    }

}